module Subtraction.Lib
    ( genOperand, output) where

genOperand :: IO ()
genOperand = putStrLn "subtract genOperand..."

gen :: Int -> [(Int,Int)]
gen n = do
    x <- [0..n]
    y <- [0..x]
    let c = return (x, y) in c

fmt :: Bool -> [(Int, Int)] -> [String]
fmt flag = map (\(a, b) -> (show a) ++ "-" ++ (show b) ++ (answer flag a b)) where
    answer flag a b
            | flag == True = "=" ++ (show $ a - b)
            | otherwise = "="

output :: Bool -> Int -> [String]
output flag = fmt flag . gen 